﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucItemDetail.ascx.cs"
    Inherits="Client_UserControl_ucItemDetail" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style type="text/css">
    .style1
    {
        width: 100%;
    }
</style>
<!-- Place this render call where appropriate -->

<script type="text/javascript">
    window.___gcfg = { lang: 'vi' };

    (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
</script>

<div class="titleContent">
    <div class="textContent">
        Chi tiết sản phẩm</div>
</div>
<div class="boxContentC">
    <div class="boxContentW">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:FormView ID="frmViewDetail" runat="server" OnDataBound="frmViewDetail_DataBound">
                    <ItemTemplate>
                        <table id="hienthi">
                            <tr>
                                <td style="width: 260px; height: 250px; text-align: center;" valign="top">
                                    <asp:Image ID="imgItem" runat="server" ImageUrl='<%# "~/ImageProcess.ashx?file=" + "~/Admin/images/items/" + Eval("ImageURL") + "&width=200&heigh=200&dd=true" %>'
                                        ToolTip='<%# Eval("ItemName") %>' />
                                    <br />
                                    <br />
                                    <asp:ImageButton ID="btnvote" runat="server" ImageUrl="~/images/icon/icon_like.jpg"
                                        OnClick="btnvote_Click" />
                                    <asp:Label ID="lbvote" runat="server" Text='<%# Eval("Vote") %>'></asp:Label>
                                    <br />
                                    <br />
                                    <asp:HyperLink ID="lnkViewItemImages" runat="server" NavigateUrl='<%#"~/ViewImage.aspx?keepThis=true&TB_iframe=true&width=600&height=510&ID=" + Eval("ItemID") %>'
                                        ToolTip="xem anh" CssClass="thickbox">Xem ảnh</asp:HyperLink>
                                    |
                                    <asp:HyperLink ID="hypsosanh" runat="server">So sánh</asp:HyperLink>
                                    |
                                    <asp:HyperLink ID="hyp4rom" runat="server" NavigateUrl="#">Diễn Đàn</asp:HyperLink>
                                    <br />
                                </td>
                                <td valign="top">
                                    <table cellpadding="3" cellspacing="3" width="100%">
                                        <tr id="hr">
                                            <td style="text-align: left; line-height: 30px">
                                                <h3>
                                                    <asp:Label ID="Label1" runat="server" Text='<%# Server.HtmlDecode(Eval("ItemName").ToString())%>'></asp:Label></h3>
                                                Giá bán :
                                                <asp:Label ID="lblPrice1" runat="server" Text='<%# double.Parse(Eval("BaseSellingPrice").ToString()).ToString("0,00.##") %>'
                                                    CssClass="clsTotalPriceCart"></asp:Label>
                                                (Đã bao gồm VAT)
                                                <br />
                                                Số Seri: <strong>
                                                    <asp:Label ID="lblCode" runat="server" Text='<%# Eval("ItemNumber") %>'></asp:Label></strong>
                                                <br />
                                                <strong style="font-family: Verdana; font-size: 13px; color: #515151;"><b>Thông tin sản
                                                    phẩm</b></strong>
                                                <br />
                                                <%# Server.HtmlDecode(Eval("ItemDescription").ToString())%>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <asp:ImageButton ID="cmdMua" runat="server" ImageUrl="~/images/addtocard.png" Width="85px"
                                                    Height="23px" OnClick="cmdMua_Click" />
                                                &nbsp;&nbsp;
                                                <asp:Label ID="lblInfoAddCart" runat="server" Text="" ForeColor="Red"></asp:Label>
                                                <g:plusone></g:plusone>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:FormView>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="boxContentW2" align="left" style="padding: 10px; margin: 20px 10px 10px 10px;
            width: 552px; border-top: dashed 1px #ccc; border-bottom: dashed 1px #ccc;">
            <h4>
                Sản phẩm liên quan</h4>
        </div>
        <div>
            <div class="boxContentC1">
                <div class="boxContentW1">
                    <div class="imgContent">
                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <td>
                                    <asp:ListView runat="server" ID="lvItems" ItemPlaceholderID="groupPlaceholder" GroupItemCount="3"
                                        GroupPlaceholderID="layoutTemplate" OnPagePropertiesChanged="lvItems_PagePropertiesChanged">
                                        <LayoutTemplate>
                                            <table id="layoutTemplate" runat="server" border="0" cellpadding="0" cellspacing="0">
                                            </table>
                                        </LayoutTemplate>
                                        <GroupTemplate>
                                            <tr>
                                                <div id="groupPlaceholder" runat="server">
                                                </div>
                                            </tr>
                                        </GroupTemplate>
                                        <ItemTemplate>
                                            <td style="padding: 10px 0 15px 0px;">
                                                <asp:HyperLink ID="lnkItemDetails" runat="server" NavigateUrl=''>
                                                    <div class="imgContent" price='<%# Eval("BaseSellingPrice") %>' matchedprice='0'
                                                        code='<%# Eval("ItemID") %>'>
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td align="center" style="padding: 0px; height: 200px">
                                                                    <table width="100%" border="0" cellspacing="0" cellpadding="5">
                                                                        <tr>
                                                                            <td class="img_border">
                                                                                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "~/ChiTietSanPham.aspx?id=" + Eval("ItemID") + "&idgroup="+ Eval("IDGroup") %>'>
                                                                                    <asp:Image ID="img" runat="server" ImageUrl='<%# "~/ImageProcess.ashx?file=" + "~/Admin/images/Items/" + Eval("ImageURL") + "&width=100&heigh=100&dd=true" %>'
                                                                                        AlternateText="No Image" /></asp:HyperLink>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <p>
                                                                                    <%# Eval("ItemName") %>
                                                                                </p>
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>
                                                                                <div class="line4">
                                                                                </div>
                                                                                <p class="textR1">
                                                                                    <strong>
                                                                                        <%# double.Parse (Eval("BaseSellingPrice").ToString()).ToString("0,00.##") %>
                                                                                        VNĐ </strong>
                                                                                </p>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="center">
                                                                    <!--class="bnt_dathang"-->
                                                                    <table border="0" cellspacing="3" cellpadding="0">
                                                                        <tr>
                                                                            <td width="1">
                                                                                <asp:HyperLink ID="lnk" runat="server" NavigateUrl='<%# "~/ChiTietSanPham.aspx?id=" + Eval("ItemID")+ "&idgroup=" + Eval("IDGroup")  %>'>
                                                                                    <asp:Image ID="Image3" runat="server" ImageUrl="~/images/chitiet.png" />
                                                                                </asp:HyperLink>
                                                                            </td>
                                                                            <td>
                                                                            </td>
                                                                            <td width="1">
                                                                                <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='' ToolTip="Thêm vào giỏ hàng">
                                                                                    <asp:Image ID="Image1" runat="server" ImageUrl="~/images/dathang.png" onclick='<%#string.Format("fn_AddToCart(\"{0}|{1}|{2}\")", Eval("ItemID").ToString(), Eval("BaseSellingPrice").ToString(),"0")%>' />
                                                                                </asp:HyperLink>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                </asp:HyperLink>
                                            </td>
                                        </ItemTemplate>
                                    </asp:ListView>
                                </td>
                            </tr>
                            <%--<tr class="paging">
                        <td style="padding-bottom: 3px">
                            <asp:ImageButton ID="btxemthem" runat="server" ImageUrl="~/images/chitiet.png" OnClick="btxemthem_Click" />
                        </td>
                    </tr>--%>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script language="javascript" type="text/javascript">
    function fn_AddToCart(productCodeAndPrice) {
        PageMethods.SetShoppingCartSesstion(productCodeAndPrice, SetShoppingCart);
    }
</script>

